var e_phone = document.getElementById("e_phone");
var enrol1 = document.getElementById("enrol1");
var enrol1_span = document.getElementById("sp");
var switch1 = document.getElementById("switch");
var float1 = document.getElementById("float");
var span1 = document.getElementById("span1")
e_phone.onclick = function(){
	e_phone.style.background = "white";
	// enrol1.style.cssText = "border-color:#d36f16";
}
e_phone.addEventListener("blur",disp);


var reg = /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/;
function disp(){
	var value = e_phone.value;
	console.log(value,value.length);
	if(reg.test(value)){
		span1.style.visibility = "hidden";
		enrol1.style.cssText = "border-color:#ccc";
	}else if(value.length===0){
		span1.style.visibility = "inherit";
	}else{
		span1.innerHTML = "请输入正确的手机号码";
		enrol1.style.cssText = "border-color:#d36f16";
		span1.style.visibility = "inherit";
	}
}
enrol1_span.onclick = function(){
	float1.style.display = "block";
}
switch1.onclick = function(){
	float1.style.display = "none";
}
